home *** CD-ROM | disk | FTP | other *** search
/ The Universe Beyond / The Universe Beyond (Mindscape).ISO / setup / uninst.inf < prev   
INI File  |  1996-08-27  |  6KB  |  206 lines

  1. DefineVariables
  2.   Text     [ProductName]           := The Universe Beyond
  3.   Text     [ProgGrpName]           := The Universe Beyond
  4.   Text     [ProductIniFile]        := TUB.INI
  5.   Text     [UnRegisterFile]        := UTUB.RGS
  6.   Text     [BitmapName]               := UNINST.BMP
  7.   Number   [Continue]              := 1011
  8.   Text     [AreYouSureText]        := Are you sure you wish to completely remove the selected application and all its components?
  9.   Text     [YES_text]              := Yes
  10.   Text     [NO_text]               := No
  11.   Text     [DelteingFilesText]     := Please wait...
  12.   Logical  [IsWinNT]               := N
  13.   Logical  [IsWin95]               := N
  14.   Logical  [IsWin31x]              := N
  15. EndDefineVariables
  16.  
  17. SetDefaultBitmap Off
  18. SetInstallModeTo Install
  19. SetTraceMode Off
  20. SetExitConfirmationPrompt off
  21. SetPopupBorderTo double
  22. SetReplacementInquiry Off
  23.  
  24. If DriveIsCDROM [InstallFromDrive]  ;; exit if run from CD.
  25.    SoLong
  26. EndIf
  27. If DriveIsRemote [InstallFromDrive]
  28.    SoLong
  29. EndIf
  30.  
  31. ShowWindow Minimize
  32. Do CheckIfWindows95
  33. Do SetInstallDir
  34. SetTopLineTo [ProductName] Uninstall
  35. If [IsWin95]
  36.    Delay 1200
  37. EndIf
  38. ShowWindow Maximize
  39. Do DisplayLogo
  40. Do CheckIfSure
  41.  
  42. Dialog BlackOnLightGray 
  43.     Uninstall complete.
  44. EndDialog
  45.  
  46. UnloadBitmap 1
  47. SoLong Quietly
  48.  
  49. Procedure CheckIfWindows95
  50.       If WIN32
  51.      If WindowsVersion >= 3.95
  52.        [IsWin95] := Y
  53.      Else
  54.        [IsWinNT] := Y  ;; Windows NT
  55.      Endif
  56.       Else
  57.      [IsWin31x] := Y    ;; Win 3.1
  58.       EndIf
  59. EndProcedure
  60.  
  61. Procedure SetInstallDir
  62.     [Number1] := LengthOf [InstallFromDirectory]
  63.     DecrementNumber [Number1]
  64.     [String1] := SubstringOf [InstallFromDirectory] from Beginning to [Number1]
  65.     [InstallationDirectory] := [String1]
  66. EndProcedure
  67.  
  68. Procedure DisplayLogo
  69.  [Number6] := (MaxX - 640)/2
  70.  [Number7] := (MaxY - 480)/2
  71.  
  72.  If MaxY > 480
  73.     [Number7] := [Number7] -22  ;; try to match bmp placement to autoruns.
  74.  EndIf
  75.  
  76.  If FileExists [InstallationDirectory]\[BitmapName]
  77.     SetBackgroundColor 0 0 0 0 0 0 ;; set to Black
  78.     LoadBitmap 1 [InstallationDirectory]\[BitmapName]
  79.     ShowBitmap 1 @xy([Number6],[Number7])
  80.  Else
  81.     SetBackgroundColor 0 0 64 0 0 255
  82.  EndIf
  83.  ShowWindow Maximize
  84. EndProcedure
  85.  
  86. Procedure UNINSTALL
  87.    If DirectoryExists [InstallationDirectory]
  88.       TextBox BlackOnLightGray
  89.      [DelteingFilesText]
  90.       EndTextBox
  91.  
  92.       If [IsWin95]
  93.          Run [InstallationDirectory]\REGISTRY.EXE [InstallationDirectory]\[UnRegisterFile]
  94.       Else
  95.      If FileExists [WindowsDirectory]\MINDSCPE.INI
  96.         ModifyTextFile [WindowsDirectory]\MINDSCPE.INI Quietly NoBackup
  97.            InSection [[ProductName]]
  98.            DeleteLine 3
  99.            DeleteLine 2
  100.            DeleteLine 1
  101.            DeleteSection [[ProductName]]
  102.          EndModifyTextFile
  103.       EndIf
  104.        EndIf
  105.  
  106.        If DirectoryExists [InstallationDirectory]\MEDIA
  107.           DeleteFiles from [InstallationDirectory]\MEDIA
  108.              *.*
  109.           EndDeleteFiles
  110.           DeleteDirectory [InstallationDirectory]\MEDIA
  111.        EndIf
  112.  
  113.        If DirectoryExists [InstallationDirectory]\THESKY\BMP
  114.           DeleteFiles from [InstallationDirectory]\THESKY\BMP
  115.              *.*
  116.           EndDeleteFiles
  117.           DeleteDirectory [InstallationDirectory]\THESKY\BMP
  118.        EndIf
  119.  
  120.        If DirectoryExists [InstallationDirectory]\THESKY\DATA
  121.           DeleteFiles from [InstallationDirectory]\THESKY\DATA
  122.              *.*
  123.           EndDeleteFiles
  124.           DeleteDirectory [InstallationDirectory]\THESKY\DATA
  125.        EndIf
  126.  
  127.        If DirectoryExists [InstallationDirectory]\THESKY\HELP
  128.           DeleteFiles from [InstallationDirectory]\THESKY\HELP
  129.              *.*
  130.           EndDeleteFiles
  131.           DeleteDirectory [InstallationDirectory]\THESKY\HELP
  132.        EndIf
  133.  
  134.        If DirectoryExists [InstallationDirectory]\THESKY
  135.           DeleteFiles from [InstallationDirectory]\THESKY
  136.              *.*
  137.           EndDeleteFiles
  138.           DeleteDirectory [InstallationDirectory]\THESKY
  139.        EndIf
  140.  
  141.        DeleteFiles from [InstallationDirectory]
  142.       *.*
  143.        EndDeleteFiles
  144.        DeleteDirectory [InstallationDirectory]
  145.  
  146.  
  147.        DeleteFiles from [WindowsDirectory]
  148.           [ProductIniFile]
  149.        EndDeleteFiles
  150.  
  151.  
  152.        If [IsWin95]
  153.       ;; Remove Program Files\Mindscape Dir if empty.
  154.       If DirectoryExists C:\PROGRA~1\MINDSC~1
  155.          If DirectoryIsEmpty C:\PROGRA~1\MINDSC~1
  156.         ChangeDirectoryTo [InstallFromDrive]:\
  157.         DeleteDirectory C:\PROGRA~1\MINDSC~1
  158.          EndIf
  159.       EndIf
  160.       [String1] := [WindowsDirectory]\Start Menu\Programs\[ProgGrpName]
  161.       LFNGetShortPathName [String1] [String2]
  162.       If [String2] <> BlankString
  163.          ProgramManagerDDE
  164.          ShowGroup([ProgGrpName],2)
  165.          DeleteGroup([ProgGrpName])
  166.          EndProgramManagerDDE
  167.       EndIf
  168.        EndIf
  169.  
  170.        If [IsWinNT]
  171.       ProgramManagerDDE
  172.          DeleteGroup([ProgGrpName])
  173.       EndProgramManagerDDE
  174.        EndIf
  175.  
  176.        If [IsWin31x]
  177.       ProgramManagerDDE
  178.         ShowGroup([ProgGrpName],1)
  179.         DeleteGroup([ProgGrpName])
  180.       EndProgramManagerDDE
  181.        EndIf
  182.    EndIf
  183. EndProcedure
  184.  
  185. Procedure CheckIfSure
  186.    DialogBox 200 60 UseHeader "The Universe Beyond" Returns [Continue] BlackOnLightGray ModalFrame
  187.       CText @xy(0,10) 200 70 [AreYouSureText]
  188.       DefPushButton @xy( 30, 35) 40 16 [YES_text] 1012
  189.       PushButton @xy(125, 35) 40 16 [NO_text] 1011
  190.    EndDialogBox
  191.    ClearScreen
  192.    If [Continue] = 1012
  193.    Else
  194.       SoLong
  195.    EndIf 
  196.    ClearScreen
  197.    Do UNINSTALL
  198. EndProcedure
  199.  
  200. Procedure DDENonFatalErrorTrap
  201. ;; Trap the dde error for ReplaceItem.
  202. ;; See Simple.Stf for more information on how to
  203. ;; use ProgramManager's DDENonFatalErrorTrap.
  204. EndProcedure
  205. EndScript
  206.